import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Page {
    id: settingsPage
    title: "登录设置"

    signal backRequested()

    background: Rectangle {
        color: "#f5f5f5"
    }

    ColumnLayout {
        anchors.fill: parent
        anchors.margins: 20
        spacing: 15

        GroupBox {
            title: "自动登录设置"
            Layout.fillWidth: true
            ColumnLayout {
                width: parent.width
                spacing: 10

                RadioButton {
                    text: "每次都需要登录"
                    checked: true
                }
                RadioButton {
                    text: "记住密码，自动登录"
                }
                RadioButton {
                    text: "仅记住用户名"
                }
            }
        }

        GroupBox {
            title: "安全设置"
            Layout.fillWidth: true
            ColumnLayout {
                width: parent.width
                spacing: 10

                CheckBox {
                    text: "启用指纹登录"
                }
                CheckBox {
                    text: "启用面部识别"
                }
            }
        }

        Item { Layout.fillHeight: true }

        Button {
            text: "保存设置"
            Layout.fillWidth: true
            onClicked: {
                console.log("保存设置")
                settingsPage.backRequested()
            }
        }

        Button {
            text: "返回"
            Layout.fillWidth: true
            onClicked: settingsPage.backRequested()
        }
    }
}
